package com.bw.skill.bind;

import android.view.View;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.databinding.BindingAdapter;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.bw.mvvm_common.BaseApplication;
import com.bw.mvvm_common.network.load.LoadImage;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.OnItemClickListener;

import org.jetbrains.annotations.NotNull;

/**
 * @author KK
 * @description:
 * @date :2021/10/27 9:08
 */
public class SecKillBind {

    @BindingAdapter(value = "adapter")
    public static void seckillAdapter(RecyclerView recyclerView, BaseQuickAdapter adapter){
        LinearLayoutManager manager = new LinearLayoutManager(BaseApplication.getApplication());
        manager.setOrientation(RecyclerView.VERTICAL);
        recyclerView.setLayoutManager(manager);
        recyclerView.setAdapter(adapter);

    }


    @BindingAdapter(value = "imag")
    public static void secDetailBind(ImageView imageView,String pic){
        LoadImage.loadMatchImg(pic,imageView);
    }
}
